From: Owen W. Taylor Date: Sun, 10 Aug 2014 07:23:48 +0000 (+0200) Subject: hwtest.js: Fix median computation X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2260 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=28cc0da151ede6f275d9e67810dc6a45e5498c33;p=gnome-shell.git hwtest.js: Fix median computation By default Array.prototype.sort() sorts all values by converting them to strings, even numbers! --- diff --git a/js/perf/hwtest.js b/js/perf/hwtest.js index fbadde433..9cc0db85e 100644 --- a/js/perf/hwtest.js +++ b/js/perf/hwtest.js @@ -270,7 +270,7 @@ function script_redrawTestDone(time) { function script_collectTimings(time) { for (let timing in redrawTimes) { let times = redrawTimes[timing]; - times.sort(); + times.sort(function(a, b) { return a - b }); let len = times.length; let median;